
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Java 基础 -- 并发集合的使用 · 寒江蓑笠的博客</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="并发包中的集合的使用">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="java-dynamic-proxy-invocationhandler-demo.html" />
    
    
    <link rel="prev" href="java-development-skills-get-stacktrace.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    Java
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="java-basic-joor.html">
            
                <a href="java-basic-joor.html">
            
                    
                    Java 基础 -- 使用 JOOR 实现反射
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="java-basic-annotation.html">
            
                <a href="java-basic-annotation.html">
            
                    
                    Java基础 -- 注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3" data-path="java-basic-threadlocal.html">
            
                <a href="java-basic-threadlocal.html">
            
                    
                    Java 基础 -- ThreadLocal
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.4" data-path="java-development-skills-get-stacktrace.html">
            
                <a href="java-development-skills-get-stacktrace.html">
            
                    
                    Java 开发技巧 -- 获取 Java 的调用栈
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.1.5" data-path="java-basic-concurrent-map-collection.html">
            
                <a href="java-basic-concurrent-map-collection.html">
            
                    
                    Java 基础 -- 并发集合的使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.6" data-path="java-dynamic-proxy-invocationhandler-demo.html">
            
                <a href="java-dynamic-proxy-invocationhandler-demo.html">
            
                    
                    Java InvocationHandler 实现动态代理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.7" data-path="java-basic-try-catch-finally.html">
            
                <a href="java-basic-try-catch-finally.html">
            
                    
                    Java 基础 -- 深入理解 try catch finally
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8" data-path="java-basic-reflect.html">
            
                <a href="java-basic-reflect.html">
            
                    
                    Java 基础 -- 反射
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.9" data-path="java-basic-io-stream.html">
            
                <a href="java-basic-io-stream.html">
            
                    
                    Java IO -- IO流的概念和分类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.10" data-path="java-basic-final.html">
            
                <a href="java-basic-final.html">
            
                    
                    Java 基础 -- 深入理解 final 修饰符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.11" data-path="java-basic-memory-manage-constructor.html">
            
                <a href="java-basic-memory-manage-constructor.html">
            
                    
                    Java 内存管理 -- 父子实例的内存控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.12" data-path="java-basic-memory-manage-inherit-object.html">
            
                <a href="java-basic-memory-manage-inherit-object.html">
            
                    
                    Java 内存管理 -- 构造方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.13" data-path="java-basic-memory-manage-memory-area.html">
            
                <a href="java-basic-memory-manage-memory-area.html">
            
                    
                    Java 内存管理 -- 内存区域的划分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.14" data-path="java-basic-memory-manage-variable.html">
            
                <a href="java-basic-memory-manage-variable.html">
            
                    
                    Java 内存管理 -- 变量的内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.15" data-path="java-basic-knowledge-generic.html">
            
                <a href="java-basic-knowledge-generic.html">
            
                    
                    Java 基础 -- 范型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.16" data-path="java-basic-knowledge-auto-boxing.html">
            
                <a href="java-basic-knowledge-auto-boxing.html">
            
                    
                    Java 基础 -- 关于自动装箱和拆箱机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.17" data-path="java-basic-knowledge-parameter-passing.html">
            
                <a href="java-basic-knowledge-parameter-passing.html">
            
                    
                    Java 基础 -- 值传递、引用传递和参数传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.18" data-path="java-basic-stringbuilder-stringbuffer.html">
            
                <a href="java-basic-stringbuilder-stringbuffer.html">
            
                    
                    Java 基础 -- StringBuilder 和 StringBuffer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.19" data-path="java-basic-knowledge-about-string.html">
            
                <a href="java-basic-knowledge-about-string.html">
            
                    
                    Java 基础 -- 深入理解 String
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.20" data-path="java-basic-linkedhashmap.html">
            
                <a href="java-basic-linkedhashmap.html">
            
                    
                    Java 基础 -- LinkedHashMap 的使用和原理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >Java 基础 -- 并发集合的使用</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x6982;&#x8FF0;">&#x6982;&#x8FF0;</h2>
<p>&#x524D;&#x9762;&#x5927;&#x591A;&#x6570;&#x96C6;&#x5408;&#x5E76;&#x4E0D;&#x9002;&#x5408;&#x7528;&#x5728;&#x5E76;&#x53D1;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x4E2D;&#xFF0C;&#x56E0;&#x4E3A;&#x5B83;&#x4EEC;&#x6CA1;&#x6709;&#x63A7;&#x5236;&#x5E76;&#x53D1;&#x8BBF;&#x95EE;&#x6570;&#x636E;&#x3002;&#x5982;&#x679C;&#x4E00;&#x4E9B;&#x5E76;&#x53D1;&#x4EFB;&#x52A1;&#x5171;&#x4EAB;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x7ED3;&#x6784;&#xFF0C;&#x800C;&#x8FD9;&#x4E2A;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x5E76;&#x4E0D;&#x9002;&#x5408;&#x7528;&#x5728;&#x5E76;&#x53D1;&#x4EFB;&#x52A1;&#x4E2D;&#xFF0C;&#x4F60;&#x5C06;&#x4F1A;&#x6709;&#x6570;&#x636E;&#x4E0D;&#x4E00;&#x81F4;&#x7684;&#x9519;&#x8BEF;&#xFF0C;&#x8FD9;&#x5C06;&#x5F71;&#x54CD;&#x5230;&#x7A0B;&#x5E8F;&#x7684;&#x6B63;&#x786E;&#x8FD0;&#x884C;&#x3002;&#x6BD4;&#x5982; ArrayList &#x7C7B;&#x3002;
&#x4E3A;&#x4E86;&#x65B9;&#x4FBF;&#x5F00;&#x53D1;&#x8005;&#x5E76;&#x53D1;&#x7F16;&#x7A0B;&#xFF0C;&#x5728; JDK 5.0 &#x4E2D;&#x52A0;&#x5165;&#x4E86;&#x5E76;&#x53D1;&#x5305; java.util.concurrent.*&#xFF0C;&#x5B83;&#x63D0;&#x4F9B;&#x4E86;&#x53EF;&#x4EE5;&#x5728;&#x5E76;&#x53D1;&#x7A0B;&#x5E8F;&#x4E2D;&#x4F7F;&#x7528;&#x7684;&#x7C7B;&#xFF0C;&#x672C;&#x6587;&#x4EC5;&#x4ECB;&#x7ECD;&#x5E76;&#x53D1;&#x7ED3;&#x5408;&#x7684;&#x7279;&#x70B9;&#x548C;&#x4F7F;&#x7528;&#x65B9;&#x6CD5;&#x3002;</p>
<p><img src="http://www.plantuml.com/plantuml/svg/SoWkIImgAStDuGh9BCb9LL3oIYnBL7YwSzlJ_ec-YGKlPxSzdT3nR67RitdRdixUfyJ5bPbNabgKbfYSgW2KHk85vnULfAQWYlabbcMc9oRbfA8AE-Vd9PSM5QNcbU0IHz6Oc5HSKfIONAAGd9DONApW2EM2f20Y27qUYSKPsCI3ipCBV3ABmNf004WhsDJewI4R1XO4YkhgeZaGIGr46jC-50qA4ACnLI4iG0GMd0MHGF4uWeDfCuf2X31-bPX-mH56s7KZ_8Mfmo4rBmMOYW00" alt="&#x6548;&#x679C;&#x56FE;"></p>
<p><img src="http://www.plantuml.com/plantuml/svg/XLJBgjim4DtxAyJTt_i5NIHDLYNqWGDTAyua5L6aL9O3Xgv3TstNWK9_8j1D_yQ1_iN5FfXed37P6C-SCsSU6cbIHXrYjRVPqaHBwkcTFchL_BqqFtxDlBLKHEFT__Ef-Vdz-kTq_Nrfpl-UiiouI66Z2r8tLkBCAQQM3v7MtFTU7yrMhonnzyAKgVcfeeeI-wtrnSwuxT0_fwyYR-XV1ktA3GN4wrKPWowYAgmkIpM56PEEHXWvnJ48ol3Dl2kg4CZ5V6SERMjjO8yTwW_kSp2HfY7ekaL7e5jGP_QzoPaMnkreZRw1pSdgEYM3maSa8VSnV7n0yjeLNu9tlYfJzyTWV31nK6rscwrwy-tbHPWvfpm_TxkKK-Jytjaoalt2Nm_m9RjFfS1ADPD_WF8Pfi8eJEODUi5wjny42Kl0Iq3Ka2OfOxxT5mu-U010SEBTbrC1i429C3f8VWcG4uroW6S0Gzfj5eKK0WsTG4Mu1sB149FPFAlC73Oe4yG6akl8se0Eq95WyUOo2o8IxQ7QM4cFQL3ZRyDeEavZbahpFPJZxuvSEkV8PokzLBAQJ9oGMrTx-me0" alt="&#x6548;&#x679C;&#x56FE;"></p>
<h2 id="&#x5E76;&#x53D1;-map-&#x6846;&#x67B6;">&#x5E76;&#x53D1; Map &#x6846;&#x67B6;</h2>
<h3 id="concurrenthashmap">ConcurrentHashMap</h3>
<p>ConcurrentHashMap &#x662F;&#x7EBF;&#x7A0B;&#x5B89;&#x5168;&#x4E14;&#x9AD8;&#x6548;&#x7684; HashMap&#xFF0C;&#x5E95;&#x5C42;&#x91C7;&#x7528;&#x5206;&#x6BB5;&#x7684;&#x6570;&#x7EC4;+&#x94FE;&#x8868;&#x5B9E;&#x73B0;&#xFF0C;&#x7EBF;&#x7A0B;&#x5B89;&#x5168;ConcurrentHashMap&#x5141;&#x8BB8;&#x591A;&#x4E2A;&#x4FEE;&#x6539;&#x64CD;&#x4F5C;&#x5E76;&#x53D1;&#x8FDB;&#x884C;&#xFF0C;&#x5176;&#x5173;&#x952E;&#x5728;&#x4E8E;&#x4F7F;&#x7528;&#x4E86;&#x9501;&#x5206;&#x79BB;&#x6280;&#x672F;&#x3002;&#x5B83;&#x4F7F;&#x7528;&#x4E86;&#x591A;&#x4E2A;&#x9501;&#x6765;&#x63A7;&#x5236;&#x5BF9;hash&#x8868;&#x7684;&#x4E0D;&#x540C;&#x90E8;&#x5206;&#x8FDB;&#x884C;&#x7684;&#x4FEE;&#x6539;&#x3002;ConcurrentHashMap&#x5185;&#x90E8;&#x4F7F;&#x7528;&#x6BB5;(Segment)&#x6765;&#x8868;&#x793A;&#x8FD9;&#x4E9B;&#x4E0D;&#x540C;&#x7684;&#x90E8;&#x5206;&#xFF0C;&#x6BCF;&#x4E2A;&#x6BB5;&#x5176;&#x5B9E;&#x5C31;&#x662F;&#x4E00;&#x4E2A;&#x5C0F;&#x7684;Hashtable&#xFF0C;&#x5B83;&#x4EEC;&#x6709;&#x81EA;&#x5DF1;&#x7684;&#x9501;&#x3002;&#x53EA;&#x8981;&#x591A;&#x4E2A;&#x4FEE;&#x6539;&#x64CD;&#x4F5C;&#x53D1;&#x751F;&#x5728;&#x4E0D;&#x540C;&#x7684;&#x6BB5;&#x4E0A;&#xFF0C;&#x5B83;&#x4EEC;&#x5C31;&#x53EF;&#x4EE5;&#x5E76;&#x53D1;&#x8FDB;&#x884C;&#x3002;</p>
<p>JDK1.8&#x7684;&#x5B9E;&#x73B0;&#x5DF2;&#x7ECF;&#x6452;&#x5F03;&#x4E86;Segment&#x7684;&#x6982;&#x5FF5;&#xFF0C;&#x800C;&#x662F;&#x76F4;&#x63A5;&#x7528;Node&#x6570;&#x7EC4;+&#x94FE;&#x8868;+&#x7EA2;&#x9ED1;&#x6811;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x6765;&#x5B9E;&#x73B0;&#xFF0C;&#x6B64;&#x65F6;&#x9501;&#x52A0;&#x5728;key&#x4E0A;&#xFF0C;&#x5E76;&#x53D1;&#x63A7;&#x5236;&#x4F7F;&#x7528;Synchronized&#x548C;CAS&#x6765;&#x64CD;&#x4F5C;&#xFF0C;&#x6574;&#x4E2A;&#x770B;&#x8D77;&#x6765;&#x5C31;&#x50CF;&#x662F;&#x4F18;&#x5316;&#x8FC7;&#x4E14;&#x7EBF;&#x7A0B;&#x5B89;&#x5168;&#x7684;HashMap&#xFF0C;&#x867D;&#x7136;&#x5728;JDK1.8&#x4E2D;&#x8FD8;&#x80FD;&#x770B;&#x5230;Segment&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#xFF0C;&#x4F46;&#x662F;&#x5DF2;&#x7ECF;&#x7B80;&#x5316;&#x4E86;&#x5C5E;&#x6027;&#xFF0C;&#x53EA;&#x662F;&#x4E3A;&#x4E86;&#x517C;&#x5BB9;&#x65E7;&#x7248;&#x672C;&#x3002;</p>
<h3 id="concurrentskiplistmap">ConcurrentSkipListMap</h3>
<p><code>ConcurrentSkipListMap</code> &#x7684; key &#x662F;&#x6709;&#x5E8F;&#x7684;&#xFF0C;&#x5E95;&#x5C42;&#x662F;&#x901A;&#x8FC7;&#x8DF3;&#x8868;&#x6765;&#x5B9E;&#x73B0;&#x7684;&#x3002;</p>
<h2 id="&#x5E76;&#x53D1;-collection-&#x6846;&#x67B6;">&#x5E76;&#x53D1; Collection &#x6846;&#x67B6;</h2>
<h3 id="blockingqueue">BlockingQueue</h3>
<p>BlockingQueue &#x5C31;&#x662F;&#x963B;&#x585E;&#x961F;&#x5217;&#xFF0C;&#x5B83;&#x662F;&#x4E00;&#x4E2A;&#x5148;&#x8FDB;&#x5148;&#x51FA;&#x7684;&#x961F;&#x5217;&#xFF0C;&#x5F53;&#x83B7;&#x53D6;&#x961F;&#x5217;&#x5143;&#x7D20;&#x4F46;&#x662F;&#x961F;&#x5217;&#x4E3A;&#x7A7A;&#x65F6;&#xFF0C;&#x4F1A;&#x963B;&#x585E;&#x7B49;&#x5F85;&#x961F;&#x5217;&#x4E2D;&#x6709;&#x5143;&#x7D20;&#x518D;&#x8FD4;&#x56DE;&#x3002;&#x5F53;&#x6DFB;&#x52A0;&#x5143;&#x7D20;&#x65F6;&#xFF0C;&#x5982;&#x679C;&#x961F;&#x5217;&#x5DF2;&#x6EE1;&#xFF0C;&#x90A3;&#x4E48;&#x7B49;&#x5230;&#x961F;&#x5217;&#x53EF;&#x4EE5;&#x653E;&#x5165;&#x65B0;&#x5143;&#x7D20;&#x65F6;&#x518D;&#x653E;&#x5165;&#x3002;
BlockingQueue &#x7684;&#x5B9E;&#x73B0;&#x90FD;&#x662F;&#x7EBF;&#x7A0B;&#x5B89;&#x5168;&#x7684;&#x3002;
BlockingQueue &#x901A;&#x5E38;&#x7528;&#x4E8E;&#x5B9E;&#x73B0;&#x751F;&#x4EA7;&#x8005;-&#x6D88;&#x8D39;&#x8005;&#x961F;&#x5217;&#x7684;&#x573A;&#x666F;&#xFF0C;&#x5F53;&#x7136;&#xFF0C;&#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x5C06;&#x5B83;&#x5F53;&#x505A;&#x666E;&#x901A;&#x7684; Collection &#x6765;&#x7528;&#x3002;</p>
<h4 id="arrayblockingqueue">ArrayBlockingQueue</h4>
<p>&#x6570;&#x7EC4;&#x963B;&#x585E;&#x961F;&#x5217;&#xFF0C;&#x5B83;&#x5B9E;&#x73B0;&#x4E86; BlockingQueue &#x63A5;&#x53E3;&#x3002;&#x5176;&#x5185;&#x90E8;&#x5B9E;&#x73B0;&#x662F;&#x5C06;&#x5BF9;&#x8C61;&#x653E;&#x5230;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#x91CC;&#x3002;</p>
<h4 id="delayqueue">DelayQueue</h4>
<p>&#x5EF6;&#x8FDF;&#x961F;&#x5217;&#xFF0C;&#x5B83;&#x5B9E;&#x73B0;&#x4E86; BlockingQueue &#x63A5;&#x53E3;&#x3002;&#x53EA;&#x6709;&#x5728;&#x5EF6;&#x8FDF;&#x671F;&#x6EE1;&#x65F6;&#x624D;&#x80FD;&#x4ECE;&#x4E2D;&#x63D0;&#x53D6;&#x5143;&#x7D20;&#x3002;&#x8BE5;&#x961F;&#x5217;&#x7684;&#x5934;&#x90E8;&#x662F;&#x5EF6;&#x8FDF;&#x671F;&#x6EE1;&#x540E;&#x4FDD;&#x5B58;&#x65F6;&#x95F4;&#x6700;&#x957F;&#x7684;Delayed &#x5143;&#x7D20;&#x3002;</p>
<h4 id="linkedblockingqueue">LinkedBlockingQueue</h4>
<p>&#x94FE;&#x963B;&#x585E;&#x961F;&#x5217;&#xFF0C;&#x5185;&#x90E8;&#x4EE5;&#x4E00;&#x4E2A;&#x94FE;&#x5F0F;&#x7ED3;&#x6784;(&#x94FE;&#x63A5;&#x8282;&#x70B9;)&#x5BF9;&#x5176;&#x5143;&#x7D20;&#x8FDB;&#x884C;&#x5B58;&#x50A8;&#x3002;</p>
<h4 id="priorityblockingqueue">PriorityBlockingQueue</h4>
<p>&#x5177;&#x6709;&#x4F18;&#x5148;&#x7EA7;&#x7684;&#x963B;&#x585E;&#x961F;&#x5217;&#xFF0C;&#x6240;&#x6709;&#x63D2;&#x5165;&#x5230; PriorityBlockingQueue &#x7684;&#x5143;&#x7D20;&#x5FC5;&#x987B;&#x5B9E;&#x73B0; java.lang.Comparable &#x63A5;&#x53E3;&#x3002;&#x56E0;&#x6B64;&#x8BE5;&#x961F;&#x5217;&#x4E2D;&#x5143;&#x7D20;&#x7684;&#x6392;&#x5E8F;&#x5C31;&#x53D6;&#x51B3;&#x4E8E;&#x4F60;&#x81EA;&#x5DF1;&#x7684; Comparable &#x5B9E;&#x73B0;&#x3002;
&#x57FA;&#x4E8E;&#x6570;&#x7EC4;&#xFF0C;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E3A;&#x4E8C;&#x53C9;&#x5806;.</p>
<h4 id="synchronousqueue">SynchronousQueue</h4>
<p>&#x5B83;&#x7684;&#x5185;&#x90E8;&#x540C;&#x65F6;&#x53EA;&#x80FD;&#x591F;&#x5BB9;&#x7EB3;&#x5355;&#x4E2A;&#x5143;&#x7D20;&#x3002;&#x5982;&#x679C;&#x8BE5;&#x961F;&#x5217;&#x5DF2;&#x6709;&#x4E00;&#x5143;&#x7D20;&#x7684;&#x8BDD;&#xFF0C;&#x8BD5;&#x56FE;&#x5411;&#x961F;&#x5217;&#x4E2D;&#x63D2;&#x5165;&#x4E00;&#x4E2A;&#x65B0;&#x5143;&#x7D20;&#x7684;&#x7EBF;&#x7A0B;&#x5C06;&#x4F1A;&#x963B;&#x585E;&#xFF0C;&#x76F4;&#x5230;&#x53E6;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x5C06;&#x8BE5;&#x5143;&#x7D20;&#x4ECE;&#x961F;&#x5217;&#x4E2D;&#x62BD;&#x8D70;&#x3002;&#x540C;&#x6837;&#xFF0C;&#x5982;&#x679C;&#x8BE5;&#x961F;&#x5217;&#x4E3A;&#x7A7A;&#xFF0C;&#x8BD5;&#x56FE;&#x5411;&#x961F;&#x5217;&#x4E2D;&#x62BD;&#x53D6;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x7684;&#x7EBF;&#x7A0B;&#x5C06;&#x4F1A;&#x963B;&#x585E;&#xFF0C;&#x76F4;&#x5230;&#x53E6;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x5411;&#x961F;&#x5217;&#x4E2D;&#x63D2;&#x5165;&#x4E86;&#x4E00;&#x6761;&#x65B0;&#x7684;&#x5143;&#x7D20;&#x3002;</p>
<h4 id="blockingdeque">BlockingDeque</h4>
<p>&#x963B;&#x585E;&#x53CC;&#x7AEF;&#x961F;&#x5217;&#xFF0C;&#x5728;&#x4E0D;&#x80FD;&#x591F;&#x63D2;&#x5165;&#x5143;&#x7D20;&#x65F6;&#xFF0C;&#x5B83;&#x5C06;&#x963B;&#x585E;&#x4F4F;&#x8BD5;&#x56FE;&#x63D2;&#x5165;&#x5143;&#x7D20;&#x7684;&#x7EBF;&#x7A0B;&#xFF1B;&#x5728;&#x4E0D;&#x80FD;&#x591F;&#x62BD;&#x53D6;&#x5143;&#x7D20;&#x65F6;&#xFF0C;&#x5B83;&#x5C06;&#x963B;&#x585E;&#x4F4F;&#x8BD5;&#x56FE;&#x62BD;&#x53D6;&#x7684;&#x7EBF;&#x7A0B;&#x3002;</p>
<h3 id="copyonwritearraylist">CopyOnWriteArrayList</h3>
<p><code>CopyOnWriteArrayList</code> &#x53EF;&#x4EE5;&#x8BF4;&#x662F; <code>ArrayList</code> &#x7684;&#x591A;&#x7EBF;&#x7A0B;&#x7248;&#x672C;&#xFF0C;&#x5B83;&#x662F;&#x7EBF;&#x7A0B;&#x5B89;&#x5168;&#x7684;&#x3002;
&#x5B83;&#x4F7F;&#x7528;&#x4E86;&#x4E00;&#x79CD;&#x53EB;&#x5199;&#x65F6;&#x590D;&#x5236;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x5F53;&#x6709;&#x65B0;&#x5143;&#x7D20;&#x6DFB;&#x52A0;&#x5230; <code>CopyOnWriteArrayList</code> &#x65F6;&#xFF0C;&#x5148;&#x4ECE;&#x539F;&#x6709;&#x7684;&#x6570;&#x7EC4;&#x4E2D;&#x62F7;&#x8D1D;&#x4E00;&#x4EFD;&#x51FA;&#x6765;&#xFF0C;&#x7136;&#x540E;&#x5728;&#x65B0;&#x7684;&#x6570;&#x7EC4;&#x505A;&#x5199;&#x64CD;&#x4F5C;&#xFF0C;&#x5199;&#x5B8C;&#x4E4B;&#x540E;&#xFF0C;&#x518D;&#x5C06;&#x539F;&#x6765;&#x7684;&#x6570;&#x7EC4;&#x5F15;&#x7528;&#x6307;&#x5411;&#x5230;&#x65B0;&#x6570;&#x7EC4;&#x3002;</p>
<!-- 
http://www.importnew.com/26461.html
https://www.cnblogs.com/cccw/p/5837448.html
https://blog.csdn.net/king866/article/details/53945400
https://www.cnblogs.com/vijozsoft/p/5585620.html
http://ifeve.com/concurrent-collections-1/
https://blog.csdn.net/ink4t/article/details/76696728
https://www.cnblogs.com/bushi/p/6681543.html
https://www.baidu.com/s?word=CopyOnWriteArrayList&tn=50000021_hao_pg&ie=utf-8&sc=UWd1pgw-pA7EnHc1FMfqnHR1rHb1rj0sPjDknBuW5y99U1Dznzu9m1YknHc3PjTdn6&ssl_sample=s_10%2Cs_77&srcqid=2489131420700060184
https://www.jianshu.com/p/5f570d2f81a2
http://www.runoob.com/java/java-collections.html
http://www.runoob.com/java/java-hashTable-class.html
-->
<!-- 
@startuml
Title "Java 并发Map集合框架图"

interface Map
interface SortedMap
interface NavigableMap
interface ConcurrentMap
interface ConcurrentNavigableMap
abstract class AbstractMap
class ConcurrentHashMap
class ConcurrentSkipListMap




Map <|.. AbstractMap
Map  <|-- ConcurrentMap
AbstractMap <|-- ConcurrentHashMap
ConcurrentMap  <|.. ConcurrentHashMap
Map  <|-- SortedMap
SortedMap <|-- NavigableMap
NavigableMap <|-- ConcurrentNavigableMap
ConcurrentMap <|-- ConcurrentNavigableMap
AbstractMap <|-- ConcurrentSkipListMap
ConcurrentNavigableMap <|.. ConcurrentSkipListMap
@enduml
-->
<!-- 

@startuml
Title "Java 并发Collection集合框架图"

interface Collection
interface Set
interface SortedSet
interface NavigableSet
interface List
interface Queue
interface BlockingQueue
interface Deque
interface BlockingDeque
interface TransferQueue
abstract class AbstractCollection
abstract class AbstractSet
abstract class AbstractQueue
class ConcurrentSkipListSet
class CopyOnWriteArrayList
class CopyOnWriteArraySet
class ArrayBlockingQueue
class ConcurrentLinkedDeque
class DelayQueue
class LinkedBlockingDeque
class LinkedBlockingQueue
class LinkedTransferQueue
class SynchronousQueue
class PriorityBlockingQueue

Collection <|.. AbstractCollection
Collection <|-- Set
Set <|.. AbstractSet
Set <|-- SortedSet
SortedSet <|-- NavigableSet
AbstractCollection  <|-- AbstractSet
AbstractSet <|-- ConcurrentSkipListSet
NavigableSet <|.. ConcurrentSkipListSet
Collection <|-- List
List <|.. CopyOnWriteArrayList
AbstractSet  <|-- CopyOnWriteArraySet
Collection <|-- Queue
Queue <|-- BlockingQueue
Queue  <|-- Deque
Deque <|-- BlockingDeque
BlockingQueue <|-- BlockingDeque
AbstractCollection  <|--  AbstractQueue
Queue <|.. AbstractQueue
BlockingQueue  <|..  ArrayBlockingQueue
AbstractQueue <|--  ArrayBlockingQueue
Deque <|.. ConcurrentLinkedDeque
AbstractCollection <|-- ConcurrentLinkedDeque
AbstractQueue  <|-- ConcurrentLinkedQueue
Queue <|.. ConcurrentLinkedQueue
AbstractQueue <|--  DelayQueue
BlockingQueue <|.. DelayQueue
AbstractQueue <|-- LinkedBlockingDeque
BlockingDeque <|.. LinkedBlockingDeque
AbstractQueue <|-- LinkedBlockingQueue
BlockingQueue <|.. LinkedBlockingQueue
BlockingQueue <|-- TransferQueue
AbstractQueue <|-- LinkedTransferQueue
TransferQueue  <|.. LinkedTransferQueue
AbstractQueue <|-- SynchronousQueue
BlockingQueue <|.. SynchronousQueue
AbstractQueue  <|-- PriorityBlockingQueue
BlockingQueue <|.. PriorityBlockingQueue
@enduml
-->
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="java-development-skills-get-stacktrace.html" class="navigation navigation-prev " aria-label="Previous page: Java 开发技巧 -- 获取 Java 的调用栈">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="java-dynamic-proxy-invocationhandler-demo.html" class="navigation navigation-next " aria-label="Next page: Java InvocationHandler 实现动态代理">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Java 基础 -- 并发集合的使用","categories":"Java","comments":true,"tags":["并发集合"],"description":"并发包中的集合的使用","date":"2015-10-18T10:00:00.000Z","level":"1.1.5","depth":2,"next":{"title":"Java InvocationHandler 实现动态代理","level":"1.1.6","depth":2,"path":"source/Java/java-dynamic-proxy-invocationhandler-demo.md","ref":"source/Java/java-dynamic-proxy-invocationhandler-demo.md","articles":[]},"previous":{"title":"Java 开发技巧 -- 获取 Java 的调用栈","level":"1.1.4","depth":2,"path":"source/Java/java-development-skills-get-stacktrace.md","ref":"source/Java/java-development-skills-get-stacktrace.md","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"expandable-chapters":{},"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"寒江蓑笠的博客","gitbook":"*"},"file":{"path":"source/Java/java-basic-concurrent-map-collection.md","mtime":"2022-05-17T10:49:59.383Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-05-17T10:54:58.084Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

